package com.sell.sell.controller;

import com.sell.sell.exception.SellException;
import com.sell.sell.util.ResultVOUtil;
import com.sell.sell.vo.ResultVO;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 描述:
 * 订单异常处理
 *
 * @author hzp
 * @create 2018-10-10 9:07
 */
@ControllerAdvice
@ResponseBody
public class MyExceptionHandlerController {

    @ExceptionHandler(SellException.class)
    public ResultVO handleSellException(SellException sellException){
        return ResultVOUtil.error(sellException.getMessage(),sellException.getCode());
    }

}
